



import 'dart:ui';

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';


main()=> runApp(CLMyapp());

class CLMyapp extends StatelessWidget{
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return MaterialApp(
        home: CLbody()
    );
  }
}


class CLbody extends StatelessWidget{

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return
      Scaffold(
        appBar: AppBar(
          title:Text("按钮") ,
        ),
        body:  CLbodycontent(),



      );
  }
}
class CLbodycontent extends StatefulWidget {
  @override
  State<StatefulWidget> createState() {
    // TODO: implement createState
    return _CLbodycontentState();
  }
}

class _CLbodycontentState extends State<CLbodycontent> {
  final imageURL = "https://img1.baidu.com/it/u=211652494,2598660937&fm=26&fmt=auto";
  final usernameTextEditController=TextEditingController();
  final passwordTextEditController=TextEditingController();
  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        FadeInImage(
          // fadeOutDuration: Duration(microseconds: 5),
          // fadeInDuration: Duration(microseconds: 5),
          image: NetworkImage(imageURL),

          placeholder: AssetImage("assets/images/a.jpg"),
        ),
        TextField(
          controller: usernameTextEditController,
          decoration: InputDecoration(
            labelText: "usename",
            icon: Icon(Icons.people),
            hintText: "请输入用户名",
            border:OutlineInputBorder(),
            filled: true,
            fillColor: Colors.white,
          ),
          onChanged: (value){print("j");},
          onSubmitted: (value){print("j");},
        ),
        SizedBox(height: 10,),
        TextField(
          controller: passwordTextEditController,
          decoration: InputDecoration(
            labelText: "password",
            icon: Icon(Icons.lock),
            hintText: "请输入密码",
            border:OutlineInputBorder(),
            filled: true,
            fillColor: Colors.white,
          ),
        ),
        Container(
          height: 40,
          width: 160,
          child: FlatButton(
            onPressed: (){
              final username=usernameTextEditController.text;
              final password=passwordTextEditController.text;
              print("账号$username");

            },
            child: Text("登录",style: TextStyle(fontSize: 20,color: Colors.orange),),
            color: Colors.blue,
          ),
        )
      ],
    )
    ;
  }
}
